import request from '@/utils/request'
import qs from 'qs';

// 拣货单表获取拣货设置
export function getPickSetting() {
  return request({
    url: '/pick/setting/get',
    method: 'GET'
  })
}
// 拣货单表获取拣货设置
export function updatePickSetting(data) {
  return request({
    url: '/pick/setting/update',
    method: 'POST',
    data
  })
}
// 新建拣货单表
export function createPick(data) {
  return request({
    url: '/pick/create',
    method: 'POST',
    data
  })
}
// 拣货单表波次统计
export function queryPickStatistics(param) {
  return request({
    url: '/pick/statistics',
    method: 'GET',
    params: param,
    paramsSerializer: params => {
      return qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
}
// 获取拣货单表列表（分页）
export function queryPickList(param) {
  return request({
    url: '/pick/page',
    method: 'GET',
    params: param,
    paramsSerializer: params => {
      return qs.stringify(params, { arrayFormat: 'repeat' })
    }
  })
}
// 获取拣货单表列表（分页）
export function queryPickLogList(param) {
  return request({
    url: '/pick/log/page',
    method: 'GET',
    params: param,
  })
}
// 获取拣货单表列表（分页）
export function printPickBatch(data) {
  return request({
    url: '/pick/print/batch',
    method: 'POST',
    data
  })
}

export function assignPickers(data) {
  return request({
    url: '/pick/assignPickers',
    method: 'POST',
    data
  })
}
